#!/bin/sh
#
# Test display and options specific to the refs view.

. libtest.sh
. libgit.sh

export LINES=18

tigrc <<EOF
set line-graphics = ascii
EOF

steps '
	:save-display refs-default.screen

	:toggle line-number
	:save-display refs-with-line-number.screen
'

in_work_dir create_repo_from_tgz "$base_dir/files/refs-repo.tgz"

test_tig refs

assert_equals 'refs-default.screen' <<EOF
                                     All references
2010-04-07 05:37 +0000 Max Power     master               Commit 10 E
2009-02-13 23:31 +0000 Max Power     mp/feature           WIP: feature
2009-12-26 01:11 +0000 作者          r1.1.2               Commit 8 C
2009-12-26 01:11 +0000 作者          r1.1.x               Commit 8 C
2009-12-17 12:49 +0000 René Lévesque r1.0                 Commit 8 B
2010-04-07 05:37 +0000 Max Power     origin/master        Commit 10 E
2010-04-07 05:37 +0000 Max Power     max-power/master     Commit 10 E
2009-02-13 23:31 +0000 Max Power     max-power/mp/feature WIP: feature
2009-11-30 12:05 +0000 Max Power     max-power/mp/gh-123  Commit 7 E
2010-04-07 05:37 +0000 Max Power     origin/HEAD          Commit 10 E
2010-01-12 01:56 +0000 Max Power     mp/good              Commit 8 E
2010-03-12 16:31 +0000 René Lévesque v2.0.1               Commit 10 B
2010-03-04 04:09 +0000 A. U. Thor    v2.0                 Commit 10 A
2010-01-20 14:18 +0000 A. U. Thor    v1.1.1               Commit 9 A
2009-12-26 01:11 +0000 作者          v1.1                 Commit 8 C
[refs] All references                                                        94%
EOF

assert_equals 'refs-with-line-number.screen' <<EOF
  1|                                      All references
   | 2010-04-07 05:37 +0000 Max Power     master               Commit 10 E
   | 2009-02-13 23:31 +0000 Max Power     mp/feature           WIP: feature
   | 2009-12-26 01:11 +0000 作者          r1.1.2               Commit 8 C
  5| 2009-12-26 01:11 +0000 作者          r1.1.x               Commit 8 C
   | 2009-12-17 12:49 +0000 René Lévesque r1.0                 Commit 8 B
   | 2010-04-07 05:37 +0000 Max Power     origin/master        Commit 10 E
   | 2010-04-07 05:37 +0000 Max Power     max-power/master     Commit 10 E
   | 2009-02-13 23:31 +0000 Max Power     max-power/mp/feature WIP: feature
 10| 2009-11-30 12:05 +0000 Max Power     max-power/mp/gh-123  Commit 7 E
   | 2010-04-07 05:37 +0000 Max Power     origin/HEAD          Commit 10 E
   | 2010-01-12 01:56 +0000 Max Power     mp/good              Commit 8 E
   | 2010-03-12 16:31 +0000 René Lévesque v2.0.1               Commit 10 B
   | 2010-03-04 04:09 +0000 A. U. Thor    v2.0                 Commit 10 A
 15| 2010-01-20 14:18 +0000 A. U. Thor    v1.1.1               Commit 9 A
   | 2009-12-26 01:11 +0000 作者          v1.1                 Commit 8 C
[refs] All references                                                        94%
EOF
